/**
 * 
 */
package data.mysql;

import java.util.HashMap;

import bean.Customer;
import data.ICustomerDao;
import data.exception.DaoException;

/**
 * Customer DAO.
 * 
 * @author chuxiaoyuan
 * 
 */
public class CustomerDao extends BaseDaoSupport<Customer> implements
		ICustomerDao {

	@Override
	protected Customer createBean() {

		return new Customer();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see data.ICustomerDao#selectById(java.lang.Long)
	 */
	@SuppressWarnings("serial")
	@Override
	public Customer selectById(final Long id) throws DaoException {

		// Select by primary key.
		return this
				.selectByPrimaryKey(new HashMap<String, Object>() {
					{
						put("id", id);
					}
				});
	}

}
